<template>
	<view>
		<web-view :src='newsUrl'></web-view>
	</view>
</template>

<script>
	import shareMsg from '@/common/shareMessage.js';
	export default {
		data() {
			return {
				newsUrl: '',
				id: ''
			}
		},
		methods: {
			onShareAppMessage(){
				var pathList = getCurrentPages()
				var path = pathList[pathList.length - 1].route
				return shareMsg.shareMsg({
					title: "AIIT图书馆",
					path: path + '?id=' + this.id,
					imageUrl: ''
				})
			},
			onLoad: function(event) {
				this.id = event.id;
				uni.setNavigationBarTitle({
					title: event.title
				})
				uniCloud.database().collection('wxNews').doc(event.id)
				.get().then(res => {
					this.newsUrl = res.result.data[0].url
				})
				
			}
		}
	}
</script>

<style>

</style>
